import { Module, VuexModule, Mutation } from "vuex-module-decorators";
@Module({
  name: "navModule",
  stateFactory: true,
  namespaced: true,
})
export default class NavModule extends VuexModule {
  navLeft: {}[] = [];
  navNews: {}[] = [];
  navVip: {}[] = [];
  navAuthor: {}[] = [];
  navAuthorEvents: {}[] = [];

  navMes: {}[] = [];
  userHistory: {}[] = [];
  userMark: {}[] = [];
  userRoutes: {}[] = [];
  userInfo: {} = {};

  @Mutation
  initNav() {
    this.navLeft = [
      { path: "/navleft1", meta: { title: "博客" } },
      { path: "/navleft2", meta: { title: "下载课程" } },
      { path: "/navleft3", meta: { title: "学习" } },
      { path: "/navleft4", meta: { title: "社区" } },
      { path: "/navleft5", meta: { title: "认证" } },
    ];
    this.navVip = [
      {
        path: "/vip1",
        meta: {
          title: "抽万元礼",
          icon: require("~/assets/images/vip/icon1.png"),
        },
      },
      {
        path: "/vip2",
        meta: {
          title: "领券中心",
          icon: require("~/assets/images/vip/icon2.png"),
        },
      },
      {
        path: "/vip3",
        meta: {
          title: "加赠一年",
          icon: require("~/assets/images/vip/icon3.png"),
        },
      },
      {
        path: "/vip4",
        meta: {
          title: "会员购",
          icon: require("~/assets/images/vip/icon4.png"),
        },
      },
    ];
    this.navNews = [
      {
        path: "/news",
        title: "投票",
        count: 200,
      },
    ];
    this.navAuthor = [
      {
        path: "/author1",
        title: "写文章",
      },
      {
        path: "/author2",
        title: "发Blink",
      },
      {
        path: "/author3",
        title: "提问题",
      },
      {
        path: "/author4",
        title: "传资源",
      },
      {
        path: "/author5",
        title: "建项目",
      },
    ];
    this.navAuthorEvents = [
      {
        text: "#「笔耕不辍」-生命不止，写作不息",
        path: "/event1",
      },
      {
        text: "#成长一夏”挑战赛来袭！开启导师报名啦",
        path: "/event2",
      },
      {
        text: "#成长一夏”挑战赛来袭！开启导师报名啦",
        path: "/event3",
      },
    ];
  }

  @Mutation
  initUserNav() {
    this.navMes = [
      {
        path: "/message1",
        meta: { title: "评论和@" },
        param: { count: 20 },
      },
      {
        path: "/message2",
        meta: { title: "新增粉丝" },
        param: { count: 0 },
      },
      {
        path: "/message3",
        meta: { title: "赞和收藏" },
        param: { count: 2 },
      },
      {
        path: "/message4",
        meta: { title: "私信" },
        param: { count: 0 },
      },
      {
        path: "/message5",
        meta: { title: "系统通知" },
        param: { count: 11 },
      },
      {
        path: "/message6",
        meta: { title: "消息设置" },
        param: { count: 12 },
      },
    ];
    this.userHistory = [
      {
        path: "/history1",
        meta: { title: "history1", tag: "博客", underline: false },
      },
      {
        path: "/history2",
        meta: { title: "history2", tag: "博客", underline: false },
      },
      {
        path: "/history3",
        meta: { title: "history3", tag: "博客", underline: false },
      },
      {
        path: "/history4",
        meta: { title: "history4", tag: "博客", underline: false },
      },
      {
        path: "/history5",
        meta: { title: "history5", tag: "博客", underline: false },
      },
      {
        path: "/history6",
        meta: { title: "history6", tag: "博客", underline: false },
      },
      {
        path: "/history7",
        meta: { title: "history7", tag: "博客", underline: false },
      },
      {
        path: "/history8",
        meta: { title: "history8", tag: "博客", underline: false },
      },
      {
        path: "/history9",
        meta: { title: "history9", tag: "博客", underline: false },
      },
      {
        path: "/history10",
        meta: { title: "history10", tag: "博客", underline: false },
      },
      {
        path: "/history11",
        meta: { title: "history11", tag: "博客", underline: false },
      },
      {
        path: "/history12",
        meta: { title: "history12", tag: "博客", underline: false },
      },
      {
        path: "/history13",
        meta: { title: "history13", tag: "博客", underline: false },
      },
      {
        path: "/history14",
        meta: { title: "history14", tag: "博客", underline: false },
      },
      {
        path: "/history15",
        meta: { title: "history15", tag: "博客", underline: false },
      },
    ];
    this.userMark = [
      {
        path: "/mark1",
        meta: { title: "mark1", tag: "博客", underline: false },
      },
      {
        path: "/mark2",
        meta: { title: "mark2", tag: "博客", underline: false },
      },
    ];
    this.userRoutes = [
      {
        path: "/zoneUser",
        meta: { title: "个人中心", icon: "", underline: false },
      },
      {
        path: "/userRoute1",
        meta: { title: "内容管理", icon: "", underline: false },
      },
      {
        path: "/userRoute2",
        meta: { title: "我的学习", icon: "", underline: false },
      },
      {
        path: "/userRoute3",
        meta: { title: "我的订单", icon: "", underline: false },
      },
      {
        path: "/userRoute4",
        meta: { title: "我的钱包", icon: "", underline: false },
      },
      {
        path: "/userRoute5",
        meta: { title: "我的云服务", icon: "", underline: false },
      },
      {
        path: "/userRoute6",
        meta: { title: "我的认证", icon: "", underline: false },
      },
      {
        path: "/userRoute7",
        meta: { title: "我的抽奖", icon: "", underline: true },
      },
    ];
    this.userInfo = {
      name: "刘卓",
      avatar: require("~/assets/images/account.jpg"),
      vip: 0,
      count: { fans: 0, follow: 0, likes: 0 },
    };
  }
}
